package org.apache.jsp.interactive;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class example_002daction_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;


    request.setAttribute("decorator", "none");
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server

      out.write("\n");
      out.write("<pre style=\"font-style: normal;\">\n");
      out.write("<span class=\"kw\">package</span> org.apache.struts2.showcase.action;\n");
      out.write("\n");
      out.write("<span class=\"kw\">import</span> java.util.Arrays;\n");
      out.write("<span class=\"kw\">import</span> java.util.Date;\n");
      out.write("<span class=\"kw\">import</span> java.util.HashMap;\n");
      out.write("<span class=\"kw\">import</span> java.util.List;\n");
      out.write("<span class=\"kw\">import</span> java.util.Map;\n");
      out.write("\n");
      out.write("<span class=\"kw\">import</span> com.opensymphony.xwork2.ActionSupport;\n");
      out.write("\n");
      out.write("<span class=\"kw\">public class</span> ExampleAction <span class=\"kw\">extends</span> ActionSupport {\n");
      out.write("    <span class=\"kw\">public static final</span> String CONSTANT = \"Struts Rocks!\";\n");
      out.write("        \n");
      out.write("    <span class=\"kw\">public static</span> Date getCurrentDate() {\n");
      out.write("        return new Date();\n");
      out.write("    }\n");
      out.write("    \n");
      out.write("    <span class=\"kw\">public</span> String getName() {\n");
      out.write("        return \"John Galt\";\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> String[] getBands() {\n");
      out.write("        return new String[] { \"Pink Floyd\", \"Metallica\", \"Guns & Roses\" };\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> List&lt;String&gt; getMovies() {\n");
      out.write("        return Arrays.asList(\"Lord of the Rings\", \"Matrix\");\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> Book getBook() {\n");
      out.write("        <span class=\"kw\">return</span> new Book(\"Iliad\", \"Homer\");\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> Map&lt;String, Book&gt; getBooks() {\n");
      out.write("        Map&lt;String, Book&gt; books = new HashMap&lt;String, Book&gt;();\n");
      out.write("        books.put(\"Iliad\", new Book(\"Iliad\", \"Homer\"));\n");
      out.write("        books.put(\"The Republic\", new Book(\"The Replublic\", \"Plato\"));\n");
      out.write("        books.put(\"Thus Spake Zarathustra\", new Book(\"Thus Spake Zarathustra\",\n");
      out.write("            \"Friedrich Nietzsche\"));\n");
      out.write("        return books;\n");
      out.write("    }\n");
      out.write("}\n");
      out.write("\n");
      out.write("<span class=\"kw\">class</span> Book {\n");
      out.write("    <span class=\"kw\">private</span> String title;\n");
      out.write("    <span class=\"kw\">private</span> String author;\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> Book(String title, String author) {\n");
      out.write("        this.title = title;\n");
      out.write("        this.author = author;\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> String getTitle() {\n");
      out.write("        <span class=\"kw\">return</span> title;\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public void</span> setTitle(String title) {\n");
      out.write("        this.title = title;\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public</span> String getAuthor() {\n");
      out.write("        return author;\n");
      out.write("    }\n");
      out.write("\n");
      out.write("    <span class=\"kw\">public void</span> setAuthor(String author) {\n");
      out.write("        this.author = author;\n");
      out.write("    }\n");
      out.write("}\n");
      out.write("</pre>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
